var vm = new Vue({
  el: '#app',
  data(){
    return {  
      textarea1:'',
      period:'',
      verify:'',
      periodOptions:'',
      verifyOptions:'',
    };  
  },
  mounted:function ( ) { // 页面加载完成后会调用此函数
    this.$nextTick(function () { // 加个函数可以保证 this和vm是一样 都可以掉用
        vm.management();
    })
  },
  methods:{
		management:function () {
	        this.$http.get('../data.json').then(res => { //作用域指向了外层 里面的this就是外面的this
	            vm.periodOptions = res.body.result.periodOptions;
	            vm.verifyOptions = res.body.result.verifyOptions;
	        }); // 调用http方法
		},
		onSubmit() {
			var access_tar = document.getElementById("access_target").value;
			var percent = document.getElementById("percent").value;
			var period = document.getElementById("period").value;
			this.$http.get('AccessController/addaccesstarget',
			{prame:{item_target:'access_tar',itempercent:'percent',Access_id:'',accessitem:'period'}}).then(res => { //作用域指向了外层 里面的this就是外面的this
				
	    });
		  console.log('submit!');
		}
  }
})
